x = input()
n = x
for i in x:
	if i in 'qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM1234567890!@#$%^&*"№;:?-+=,./\|<>_':
		x = x.replace(1,'')
for i in range (len(x)):
	x = x.replace('','') 
	x = x.replace('()','')
	x = x.replace('[]','')
	x = x.replace('{}','')
	x = x.replace('<>','')
if len(x) == 0:
		print('True',n)
else:
	print('False',x)
